package com.example.loginserver.controller;

import com.example.loginserver.utils.Result;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

@RestController
public class HelloController {


    @GetMapping("/userInfo")
    public Result getUserInfo(HttpServletResponse response) {

//        response.addCookie();

        return Result.OK(SecurityContextHolder.getContext().getAuthentication());
    }


}
